
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet"
	type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>预付款申请记录</title>
</head>
<body>
	<nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 预付款申请记录 
		<a class="btn btn-success btn-refresh radius r mr-20"
			style="line-height:1.6em;margin-top:3px" onclick="javascript:location.replace(location.href);"
			href="javascript:location.replace(location.href);" title="刷新">刷新</a>
	</nav>
	<div class="pd-20">
		 <div class="cl pd-5 bg-1 bk-gray" style="margin-top:20px;">

			<form action="<%=path%>/backstage/shopApplyList" method="post"
				class="form form-horizontal" id="form-goods-add">
				<div class="text-c">
				<div class="row cl">
					<label class="form-label col-1">店铺名：</label>
					<div class="formControls col-2">
						<input type="hidden" value="${cond.status }" name="status" id="status">
						<input type="text" value="${tj.sname }" name="sname" id="name" placeholder="店铺名" class="input-text">
					</div>
					<label class="form-label col-1">开始时间：</label>
					<div class="formControls col-2">
						<input type="text"  name="stime"  onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')}'})"  value="${tj.stime}"  id="datemin" class="input-text Wdate" >
					</div>
					<label class="form-label col-1">结束时间：</label>
					<div class="formControls col-2">
						<input type="text" name="etime" value="${tj.etime}" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}'})" id="datemax" class="input-text Wdate" >
					</div>
				</div>
				<div class="row cl">
					<button name="" id="" class="btn btn-success" style="border-radius:5px;float:right;" type="submit">
						 查询
					</button>
					<div style="width:10px;height:5px;float:right;"></div>
				</div>
				</div>
			</form>
		</div>

		<div class="mt-20">
			<table
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
                            <th width="80">商家账户名</th>
                            <th width="80">商家名称</th>
                            <th width="80">所属站点</th>
                            <th width="80">商家类型</th>
                            <th width="80">日均订单额</th>
                            <th width="80">商家营业日期</th>
                            <th width="80">申请时间</th>
                            <th width="80">申请金额</th>
                            <th width="80">BD人员</th>
                            <th width="80">状态</th>
                            <th width="80">备注</th>
							<th width="100">操作</th>
					</tr>
				</thead>
				<tbody>
						<c:forEach items="${apply}" var="t_shops_apply">
						
						<tr class="text-c">
                            	<td>${t_shops_apply.c_uname}</td>
                                <td>${t_shops_apply.c_sname}</td>
                                <td>${t_shops_apply.name}</td>
                                <td>${t_shops_apply.c_name}</td>
                                <td>${t_shops_apply.day_avg_money}</td>
                                <td>${t_shops_apply.c_appdate}</td>
                                <td>${t_shops_apply.create_time}</td>
                                <td>${t_shops_apply.money}</td>
                                <td>${t_shops_apply.bd_user}</td>
                                <td>
                                	<c:if test="${t_shops_apply.status==0}">待审核</c:if>
                                	<c:if test="${t_shops_apply.status==1}">审核通过</c:if>
                                	<c:if test="${t_shops_apply.status==2}">审核失败</c:if>
                                </td>
                                <td>${t_shops_apply.remark}</td>
							<td class="td-manage">
								<c:if test="${t_shops_apply.is_pmoney!=1}">
								<c:if test="${t_shops_apply.status==0}">
									<a style="text-decoration:none"
										onClick="t_shops_apply_edit('${t_shops_apply.id}','${t_shops_apply.status }')" href="javascript:void(0);"
										title="编辑">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
								</c:if>
								<c:if test="${t_shops_apply.status==2}">
									<a style="text-decoration:none"
										onClick="t_shops_apply_edit('${t_shops_apply.id}','${t_shops_apply.status }')" href="javascript:void(0);"
										title="编辑">编辑</a>
								</c:if>
								<c:if test="${t_shops_apply.status==0}">
									<a style="text-decoration:none"
										onClick="check_apply('${t_shops_apply.id}')" href="javascript:void(0);"
										title="审核">审核</a>
								</c:if>
								<c:if test="${t_shops_apply.status==1}">
									<a style="text-decoration:none"
										onClick="pmoney_apply('${t_shops_apply.c_id}','${t_shops_apply.money}','${t_shops_apply.id}')" href="javascript:void(0);"
										title="打款">打款</a>
								</c:if>
								</c:if>
								<c:if test="${t_shops_apply.is_pmoney==1}">
									已打款
								</c:if>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<input type="hidden" id="applyid">
			<input type="hidden" id="shopid">
			<input type="hidden" id="money">
			<input type="hidden" id="status">
		</div>
	</div>
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript">
		$(function() {
			$('.table-sort').dataTable({
				"aaSorting" : [ [ 4, "desc" ] ],//默认第几个排序
				"bStateSave" : true,//状态保存
				"aoColumnDefs" : [
				//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
				{
					"orderable" : false,
					"aTargets" : [ 0,1,2,3,8,9,10,11 ]
				} // 制定列不参与排序
				]
			});
			$('.table-sort tbody').on('click', 'tr', function() {
				if ($(this).hasClass('selected')) {
					$(this).removeClass('selected');
				} else {
					table.$('tr.selected').removeClass('selected');
					$(this).addClass('selected');
				}
			});
		});

		/*添加*/
		function t_shops_apply_add(title, url, w, h) {
			layer_show(title, url, w, h);
		}

		/*编辑*/
		function t_shops_apply_edit(id,status){
		$("#status").val(status);
			var edit_page = "<%=path%>/backstage/shopApplyAddPre?id="+id;
			layer_show("编辑",edit_page);
		}
		
		/*审核*/
		function check_apply(id){
			$("#applyid").val(id);
			var edit_page = "<%=path%>/backstage/check_apply.jsp";
			layer_show("审核",edit_page);
		}
		
		/*打款*/
		function pmoney_apply(shopid,money,applyid){
			$("#shopid").val(shopid);
			$("#money").val(money);
			$("#applyid").val(applyid);
			var edit_page = "<%=path%>/backstage/pmoney_apply.jsp";
			layer_show("审核",edit_page);
		}

		/*删除*/
		function t_shops_apply_delete(obj,id){
			layer.confirm('确认删除？', {
				btn: ['确认','取消'], 
				shade: false
			},
			function(){
				$.ajax({
					type : "POST",
					url : "<%=path%>/backstage/t_shops_apply-delete",
					data : "id=" + id,
					error : function() {
						layer.msg('操作失败', {icon:5,time:1000});
					},
					success : function(msg) {
						layer.msg('已删除 ' + msg.information, {icon:6,time:1000});
						$(obj).parents("body").find(".btn-refresh").click();
					}
				});
			},
			function(){
				layer.msg('未删除', {icon:5,time:1000});
			});	
		}
	</script>
</body>
</html>



